package com.bit.java1;

import java.util.Arrays;

public class Test3 {

    public static int[] searchDigitalAdd(int[] array, int val) {
            for(int i = 0; i < array.length - 1; i++) {
                for(int j = i + 1; j < array.length - 1; j++) {
                    if(array[i] + array[j] == val) {
                        int[] ret = new int[2];
                        ret[0] = i;
                        ret[1] = j;
                        return ret;
                     }
                }
            }
            return null;
    }

    public static void main(String[] args) {
        int[] array = {3, 2, 7, 11, 15};
        int[] p = searchDigitalAdd(array,9);
        System.out.println(Arrays.toString(p));
    }


}